#
# makefile
# 
#  Este archivo es parte del proyecto NPASM, un ensamblador para
# microcontroladores PIC con sintaxis Intel, desarrollado inicialmente
# por Fabian Machado (fabianjsm@gmail.com, twitter@fabianjsm).
#  El codigo fuente esta diponible en el repositorio SVN de Google:
#      http://npasm.googlecode.com/svn/trunk.
# 
# Septiembre de 2011.
#
CPP     = g++
LD      = g++
ALL     = npasm
OBJLNK  = npasm.o opciones.o entorno.o auxiliar.o lexico.o sintaxis.o \
            ts.o simbolo.o opcode.o emitir.o mm.o hex.o tstring.o \
            directiva.o cmd.o
COMFLG  = -Wall -g -O2
CPPFLG  = $(COMFLG)
YACC    = bison
FLEX    = flex

.SUFFIXES: .cpp .l .y
.PHONY: clean

.cpp.o:
	$(CPP) $(CPPFLG) -c -o$@ $<

%.cpp : %.y
	$(YACC) -d -o$@ $<
	mv $*.hpp $*.h

%.cpp: %.l
	$(FLEX) -o$@ $<

all: $(ALL)

clean:
	rm -f *.o

dep:
	makedepend $(OBJLNK:.o=.cpp)

test: $(ALL)
	./$(ALL) ../test/serie/serie.asm -I../include

install: ./$(ALL)
	cp ./$(ALL)  /usr/local/bin
	chmod a+x    /usr/local/bin/$(ALL)
	mkdir -p /usr/share/npasm/include
	cp ../include/* /usr/share/npasm/include
	chmod -R a+r /usr/share/npasm/include

uninstall:
	rm -rf /usr/share/npasm
	rm -f /usr/local/bin/$(ALL)

$(ALL): $(OBJLNK)
	$(LD) $(LDFLG) -o$@ $(OBJLNK)

# Dependencias
sintaxis.h: sintaxis.o
sintaxis.o: sintaxis.cpp
sintaxis.cpp: sintaxis.y
lexico.o: lexico.cpp sintaxis.h
lexico.cpp: lexico.l
# -- No editar las demas dependencias: son generadas con 'make dep'
# DO NOT DELETE

npasm.o: /usr/include/stdlib.h /usr/include/features.h
npasm.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
npasm.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
npasm.o: /usr/include/gnu/stubs-32.h /usr/include/sys/types.h
npasm.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
npasm.o: /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h
npasm.o: /usr/include/bits/byteswap.h /usr/include/sys/select.h
npasm.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
npasm.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
npasm.o: /usr/include/bits/pthreadtypes.h /usr/include/alloca.h entorno.h
npasm.o: ts.h simbolo.h opcode.h emitir.h mm.h /usr/include/ctype.h
npasm.o: /usr/include/xlocale.h tstring.h directiva.h npasm.h opciones.h
npasm.o: auxiliar.h hex.h
opciones.o: /usr/include/getopt.h /usr/include/ctype.h
opciones.o: /usr/include/features.h /usr/include/bits/predefs.h
opciones.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
opciones.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
opciones.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
opciones.o: /usr/include/endian.h /usr/include/bits/endian.h
opciones.o: /usr/include/bits/byteswap.h /usr/include/xlocale.h entorno.h
opciones.o: ts.h simbolo.h opcode.h emitir.h mm.h tstring.h directiva.h
opciones.o: npasm.h opciones.h
entorno.o: /usr/include/stdio.h /usr/include/features.h
entorno.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
entorno.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
entorno.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
entorno.o: /usr/include/bits/typesizes.h /usr/include/libio.h
entorno.o: /usr/include/_G_config.h /usr/include/wchar.h
entorno.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
entorno.o: entorno.h ts.h simbolo.h opcode.h emitir.h mm.h
entorno.o: /usr/include/ctype.h /usr/include/endian.h
entorno.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
entorno.o: /usr/include/xlocale.h tstring.h directiva.h auxiliar.h
auxiliar.o: /usr/include/stdio.h /usr/include/features.h
auxiliar.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
auxiliar.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
auxiliar.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
auxiliar.o: /usr/include/bits/typesizes.h /usr/include/libio.h
auxiliar.o: /usr/include/_G_config.h /usr/include/wchar.h
auxiliar.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
auxiliar.o: /usr/include/limits.h /usr/include/bits/posix1_lim.h
auxiliar.o: /usr/include/bits/local_lim.h /usr/include/linux/limits.h
auxiliar.o: /usr/include/bits/posix2_lim.h /usr/include/ctype.h
auxiliar.o: /usr/include/endian.h /usr/include/bits/endian.h
auxiliar.o: /usr/include/bits/byteswap.h /usr/include/xlocale.h auxiliar.h
lexico.o: /usr/include/stdio.h /usr/include/features.h
lexico.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
lexico.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
lexico.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
lexico.o: /usr/include/bits/typesizes.h /usr/include/libio.h
lexico.o: /usr/include/_G_config.h /usr/include/wchar.h
lexico.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
lexico.o: /usr/include/string.h /usr/include/xlocale.h /usr/include/errno.h
lexico.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
lexico.o: /usr/include/asm/errno.h /usr/include/asm-generic/errno.h
lexico.o: /usr/include/asm-generic/errno-base.h /usr/include/stdlib.h
lexico.o: /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h
lexico.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
lexico.o: /usr/include/sys/select.h /usr/include/bits/select.h
lexico.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
lexico.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
lexico.o: /usr/include/alloca.h npasm.h sintaxis.h auxiliar.h entorno.h ts.h
lexico.o: simbolo.h opcode.h emitir.h mm.h /usr/include/ctype.h tstring.h
lexico.o: directiva.h /usr/include/unistd.h /usr/include/bits/posix_opt.h
lexico.o: /usr/include/bits/confname.h /usr/include/getopt.h
sintaxis.o: npasm.h ts.h simbolo.h opcode.h entorno.h emitir.h mm.h
sintaxis.o: /usr/include/ctype.h /usr/include/features.h
sintaxis.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
sintaxis.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
sintaxis.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
sintaxis.o: /usr/include/bits/typesizes.h /usr/include/endian.h
sintaxis.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
sintaxis.o: /usr/include/xlocale.h tstring.h directiva.h auxiliar.h cmd.h
ts.o: ts.h simbolo.h opcode.h
simbolo.o: /usr/include/string.h /usr/include/features.h
simbolo.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
simbolo.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
simbolo.o: /usr/include/gnu/stubs-32.h /usr/include/xlocale.h simbolo.h
simbolo.o: opcode.h auxiliar.h
opcode.o: entorno.h ts.h simbolo.h opcode.h emitir.h mm.h
opcode.o: /usr/include/ctype.h /usr/include/features.h
opcode.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
opcode.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
opcode.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
opcode.o: /usr/include/bits/typesizes.h /usr/include/endian.h
opcode.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
opcode.o: /usr/include/xlocale.h tstring.h directiva.h sintaxis.h
emitir.o: auxiliar.h emitir.h ts.h simbolo.h opcode.h entorno.h mm.h
emitir.o: /usr/include/ctype.h /usr/include/features.h
emitir.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
emitir.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
emitir.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
emitir.o: /usr/include/bits/typesizes.h /usr/include/endian.h
emitir.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
emitir.o: /usr/include/xlocale.h tstring.h directiva.h sintaxis.h
mm.o: mm.h /usr/include/ctype.h /usr/include/features.h
mm.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
mm.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
mm.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
mm.o: /usr/include/bits/typesizes.h /usr/include/endian.h
mm.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
mm.o: /usr/include/xlocale.h emitir.h ts.h simbolo.h opcode.h auxiliar.h
mm.o: sintaxis.h entorno.h tstring.h directiva.h
hex.o: /usr/include/stdio.h /usr/include/features.h
hex.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
hex.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
hex.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
hex.o: /usr/include/bits/typesizes.h /usr/include/libio.h
hex.o: /usr/include/_G_config.h /usr/include/wchar.h
hex.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
hex.o: auxiliar.h entorno.h ts.h simbolo.h opcode.h emitir.h mm.h
hex.o: /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h
hex.o: /usr/include/bits/byteswap.h /usr/include/xlocale.h tstring.h
hex.o: directiva.h hex.h
tstring.o: tstring.h
directiva.o: /usr/include/stdio.h /usr/include/features.h
directiva.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
directiva.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
directiva.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
directiva.o: /usr/include/bits/typesizes.h /usr/include/libio.h
directiva.o: /usr/include/_G_config.h /usr/include/wchar.h
directiva.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
directiva.o: auxiliar.h entorno.h ts.h simbolo.h opcode.h emitir.h mm.h
directiva.o: /usr/include/ctype.h /usr/include/endian.h
directiva.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
directiva.o: /usr/include/xlocale.h tstring.h directiva.h sintaxis.h
cmd.o: cmd.h ts.h simbolo.h opcode.h sintaxis.h auxiliar.h entorno.h emitir.h
cmd.o: mm.h /usr/include/ctype.h /usr/include/features.h
cmd.o: /usr/include/bits/predefs.h /usr/include/sys/cdefs.h
cmd.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
cmd.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
cmd.o: /usr/include/bits/typesizes.h /usr/include/endian.h
cmd.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
cmd.o: /usr/include/xlocale.h tstring.h directiva.h
